X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flibs%2FJavaScriptMinifierTest.php;h=d6a104002bd492eb4a968bda91d819a2680bb288;hb=f2ef535e3959372dd84f527cb7d45600c56c93a9;hp=3787962affd7ddcb30ce537b6fc76d5567c65444;hpb=e5facc46bc170c302438f60849041b0d6be75e82;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index 3787962aff..d6a104002b 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -2,6 +2,8 @@ class JavaScriptMinifierTest extends PHPUnit_Framework_TestCase { + use MediaWikiCoversValidator; + public static function provideCases() { return [ @@ -10,7 +12,7 @@ class JavaScriptMinifierTest extends PHPUnit_Framework_TestCase { [ "/* Foo *\n*bar\n*/", "" ], /** - * Slashes used inside block comments (bug 26931). + * Slashes used inside block comments (T28931). * At some point there was a bug that caused this comment to be ended at '* /', * causing /M... to be left as the beginning of a regex. */ @@ -59,13 +61,35 @@ class JavaScriptMinifierTest extends PHPUnit_Framework_TestCase { [ "0xFF.\nx;", "0xFF.x;" ], [ "5.3.\nx;", "5.3.x;" ], + // Cover failure case for incomplete hex literal + [ "0x;", false, false ], + + // Cover failure case for number with no digits after E + [ "1.4E", false, false ], + + // Cover failure case for number with several E + [ "1.4EE2", false, false ], + [ "1.4EE", false, false ], + + // Cover failure case for number with several E (nonconsecutive) + // FIXME: This is invalid, but currently tolerated + [ "1.4E2E3", "1.4E2 E3", false ], + // Semicolon insertion between an expression having an inline - // comment after it, and a statement on the next line (bug 27046). + // comment after it, and a statement on the next line (T29046). [ "var a = this //foo bar \n for ( b = 0; c < d; b++ ) {}", "var a=this\nfor(b=0;c